package lab02.test03;

/**
 * Created by 123 on 2017/10/13.
 */
public class Student {
    //1 属性
    int computer;
    int math;
    int english;


    //2 行为

    int totalGradl(int computer, int math, int english) {
        int sum = computer + math + english;
        return sum;
    }//求总成绩

    int average(int computer, int math, int english) {
        int average = (computer + math + english) / 3;
        return average;
    }//求平均成绩

    int highest(int computer, int math, int english) {
        int highest;
        highest = (computer > math) ? computer : math;
        highest = (highest > english) ? highest : english;
        return highest;
    }//求最高成绩

    int lowest(int computer, int math, int english) {
        int lowest;
        lowest = (computer < math) ? computer : math;
        lowest = (lowest > english) ? lowest : english;
        return lowest;
    }//求最低成绩

    //3 构造方法

    @Override
    public String toString() {
        return "computer;" + computer + "math;"+math + "english;" + english + "sum;" + totalGradl(computer, math, english) + "averagr;" + average(computer, math, english) + "highest;" + highest(computer, math, english) + "lowest" + lowest(computer, math, english);
    }
}
